																														
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
	    <meta charset="utf-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
	    <#include "/common/meta.ftl"/>
	    <#include "/common/form.ftl"/>
		<script>
		$(function(){
			
			$("#form").validate({
					rules: {
						
					},
					errorElement: "div",
					errorPlacement: function(error, element) {
						error.appendTo($(element).parent());
						$(element).parent().addClass("has-error");
						$(error).addClass("help-block alert-danger");
					},
					success: function(label) {
						$(label).parent().removeClass("has-error");
						$(label).remove();
					}
				})
			});
			function save(){
				if($("#form").valid()){
					$("#form").submit();
				}
			}
			
			function reportedSexChange() {
				$("#reportedSex").val($("#reportedRtype option:selected").val());
		    }
		    function disSexChange() {
				$("#disSex").val($("#disRtype option:selected").val());
		    }
		    //种类选择
		    function changeKind(value) {
		    	$("#kindId").val(value);
		    }
		    //级别选择
		    function changePost(value) {
		   	 $("#reportedUnitLevel").val(value);
		    }
		    
		     //转储赋值
		     function changeDump(value){
		     	var mxcode = $("#region option:selected").val();
		     	var discloseId = $("#discloseId").val();
	     		$.post('./changeDump', {mxcode: mxcode,discloseId:discloseId}, 
	     		
	     			function(data) {
						if(data.success){
							layer.msg('转储成功!',{time:500},function(){
								var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
								parent.layer.close(index);
							});
						}
					},'json');
		     }
		     
		      //导出word
		     function exportWord(){
		     	
		    	 var discloseId = $("#discloseId").val();
		     	 layer.confirm('您确定要导出word录吗？',{
					btn: ['确定','取消'] //按钮
					}, function(index){
						layer.close(index);
		     	 		location.href = "./exportWord?discloseId="+discloseId;
		     	 	});
		     }
		    
		</script>
<style>
	fieldset > legend {
	    border-bottom: 0 none;
	    font-size: 14px;
	    font-weight: bolder;
	    margin: 0 0 0 -5px;
	    padding: 0 5px;
	    width: auto;
	}
	fieldset {
	    border: 1px solid #e5e5e5;
	    margin-bottom: 10px;
	    padding: 10px 10px 0px;
	}
</style>
	</head>
	<body style="padding:5px;">
		<div class="panel panel-primary">
			<div class="panel-heading" style="">
				<strong>
					<i class="icon-pencil"></i> 举报单位编辑
				</strong>
			</div>
			<div class="panel-body" style="padding:5px;padding-top:15px;">
			<form id="form" class="form-horizontal" role="form" method='post' action="./discloseSave">
			<input type="hidden" id="discloseId" name="discloseId" value="${ discloseId }"/>
			<input type='hidden'  name="reportedSex"  id='reportedSex' value='${ formData.reportedSex!'0' }' class='form-control' />
			<input type='hidden'  name="disSex"  id='disSex' value='${ formData.disSex!'0' }' class='form-control' />	
			<input type='hidden'  name="kindId"  id='kindId' value='${ formData.kindId!'' }' class='form-control' />	
			<input type='hidden'  name="discloseType"  id='discloseType' value='${ formData.discloseType!'' }' class='form-control' />
			<input type='hidden'  name="mxcode"  id='mxcode' value='${ formData.mxcode!'' }' class='form-control' />	
			<fieldset>
				<legend><i class="icon icon-file-text-o"></i> 举报人信息</legend>
					<div class="">
							<table class="table table-bordered table-condensed">
								<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >举报人姓名</th>
						    		<td ><input type='text'  name="disName"  id='disName' value='${ formData.disName!'' }' class='form-control' /></td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >身份证号</th>
						    		<td ><input type='text'  name="identityCard"  id='identityCard' value='${ formData.identityCard!'' }' class='form-control' /></td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >举报人性别</th>
						    		<td >
						    		<select id="disRtype" name="disRtype" class="form-control" style="width:97%;height:30px;"
			                                onchange="disSex();"> 
		                                <#assign disSex = 0>
		                                <#if formData.disSex?exists>
				             				<#assign disSex = (formData.disSex!'')/>
				             			</#if>
			                            <option  value="0" <#if disSex == 0>selected</#if>>女</option>
          								<option value="1" <#if  disSex == 1>selected</#if>>男</option>
			                        </select> 
			                        
						    		</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >所在单位</th>
						    		<td colspan="3"><input type='text'  name="disUnit"  id='disUnit' value='${ formData.disUnit!'' }' class='form-control' /></td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >职务</th>
						    		<td ><input type='text'  name="disPost"  id='disPost' value='${ formData.disPost!'' }' class='form-control' /></td>
						    		
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >所在地区</th>
						    		<td colspan="3"><input type='text'  name="disRegion"  id='disRegion' value='${ formData.disRegion!'' }' class='form-control' /></td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >邮政编码</th>
						    		<td ><input type='text'  name="zipCode"  id='zipCode' value='${ formData.zipCode!'' }' class='form-control' /></td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >联系电话</th>
						    		<td ><input type='text'  name="phone"  id='phone' value='${ formData.phone!'' }' class='form-control' /></td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >手机</th>
						    		<td ><input type='text'  name="telephone"  id='telephone' value='${formData.telephone!'' }' class='form-control' /></td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >Email</th>
						    		<td ><input type='text'  name="email"  id='email' value='${ formData.email!'' }' class='form-control' /></td>
						    		
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >联系地址</th>
						    		<td colspan="5"><input type='text'  name="address"  id='address' value='${ formData.address!'' }' class='form-control' /></td>
						  		</tr>
							</table>
						</div>	
				</fieldset>
				<fieldset>
				<legend><i class="icon icon-file-text-o"></i> 被举报单位信息</legend>
					<div class="">
							<table border="0" style="width=100%">
								<tr style="">
						    		<th width="100px" style="text-align:right;" >举报编号:</th>
						    		<td width="78%">${ formData.reportCode!'' }</td>
						    		<th  width="100px">举报日期:</th>
						    		<td width="120px">${ formData.disDate!'' }</td>
						    		<!-- disPost-->
						  		</tr>
						  	</table>
							<table class="table table-bordered table-condensed">
								
						  		<tr style="">
						  			<th width="100" style="text-align:center;background-color:#eee;" >举报信息来源</th>
						    		<td ><input type='text'  name="mxname"  id='mxname' readOnly value='${ formData.mxname!'' }' class='form-control' /></td>
						  		
						    		<th width="100" style="text-align:center;background-color:#eee;" >信息种类</th>
						    		<td colspan="3"><input type='hidden'  name="kindName"  id='kindName' value='${ formData.kindName!'' }' class='form-control' />
							    		<select class="form-control" name="kind" id="kind" placeholder=""  style="width:90%" onchange="changeKind(this.value);">
						   					<option value="" ></option>
						   					 <#assign kindId = "">
			                                <#if formData?exists>
					             				<#assign kindId = (formData.kindId!'')/>
					             			</#if>
						   					<#list reportKindList as x>
						   						<option value="${x.kindId}" <#if x.kindId == kindId>selected</#if> >${x.kindName}</option>
						   					</#list>
						   				</select>
						    		</td>
						    								    		
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >单位名称</th>
						    		<td ><input type='text'  name="reportedName"  id='reportedName' value='${ formData.reportedName!'' }' class='form-control' /></td>
									<th  style="text-align:center;background-color:#eee;" >单位级别</th>
						    		<td colspan="3">
						    			<input type='hidden'  name="reportedUnitLevel"  id='reportedUnitLevel' value='${ formData.reportedUnitLevel!'' }' class='form-control' />
						    			<select class="form-control" name="kind" id="kind" placeholder=""  style="width:90%" onchange="changePost(this.value);">
						   					<option value="" ></option>
						   					 <#assign levle = "">
			                                <#if formData?exists>
					             				<#assign levle = (formData.reportedUnitLevel!'')/>
					             			</#if>
						   					<#list postList as x>
						   						<option value="${x.postId}" <#if x.postId == levle>selected</#if> >${x.postName}</option>
						   					</#list>
						   				</select>
						    		</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >所在地区</th>
						    		<td colspan="5"><input type='text'  name="reportedRegion"  id='reportedRegion' value='${ formData.reportedRegion!'' }' class='form-control' /></td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >主要问题</th>
						    		<td colspan="5">
						    		
						    		<textarea id="mainContent" name="mainContent" type="text/plain" style="width:100%;height:200px;">${formData.mainContent!''}</textarea>
						    		</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >数据转储</th>
						    		<td colspan="3">
						    			<select id="region" name="region" class="form-control" 
						    				style="width:100%;height:30px;"onchange ="changeDump(this.value);" > 
				                             <#assign region = '0311'>
				                             
				                             <#if reportRegionList?exists>
				                             	<#assign region = (formData.mxcode!'')/>
				                             	
					                            <#list reportRegionList as x>
							   						<option value="${x.regionCode!''}" <#if x.regionCode == region>selected</#if> >${x.regionName!''}</option>
							   					</#list>
						   					 </#if>
				                        </select> 
				                       
						    		</td>
						    		<td width=300px>
						    			<span style = "color:red;float:left"> 注：选择下拉进行数据转储</span>
						    		</td>
						    		<td width="120px" align="center">
						    			<button type="button" onclick="exportWord()">导出word</button>
						    		</td>
						  		</tr>
							</table>
						</div>	
				</fieldset>
				<div style="margin-top:5px;padding:5px;text-align:center;">
					<button class="btn btn-primary" type="button" onclick="save();"><i class="icon icon-save"></i> 保存</button>
					<button class="btn" type="button" onclick="history.go(-1);"><i class="icon icon-reply"></i> 返回</button>
				</div>
			</form>
		  	</div>
		</div>
	</body>
</html>